﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.IO;

namespace tscsclassgen
{
    /// <summary>
    /// ResultDialog.xaml の相互作用ロジック
    /// </summary>
    public partial class ResultDialog : Window
    {
        public ResultDialog(IEnumerable<ClassDef> classes, IEnumerable<TypeNamePair> typeNameMapping)
        {
            InitializeComponent();
            TextBoxTS.Text = GenTS.Generate(classes);
            TextBoxCS.Text = GenCS.Generate(classes, typeNameMapping);
        }

        private void CopyTS_Click(object sender, RoutedEventArgs e)
        {
            Clipboard.SetData(DataFormats.Text, TextBoxTS.Text);
        }

        private void CopyCS_Click(object sender, RoutedEventArgs e)
        {
            Clipboard.SetData(DataFormats.Text, TextBoxCS.Text);
        }
    }
}
